<template>
    <childComponent />
</template>

<script setup lang="jsx">
import { reactive } from "vue";

const info = reactive({
    name: '赵云',
    age: 18,
    occupation: ''
});

const childComponent = () => {
    const handleSearch = () => {
        info.occupation = '镇东将军';
    }

    return (
        <div>
            <div>我是{info.name},我今年{info.age}岁了</div>
            <div>我的职业是：{info.occupation}</div>
            <el-button type="primary" onClick={handleSearch}>查询职业</el-button>
        </div>
    )
}
</script>
